package GUI;

import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.LayoutManager;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class GUI_page01_UserSelection extends JPanel {

	JLabel titleLabel;
	JLabel selectUserLabel;
	JButton continueButton;
	static String[] userTypes = { "Clerk", "Customer", "Manager", "Admin" };
	JComboBox userList;
	
	public GUI_page01_UserSelection() {
		this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
		this.setBackground(Color.white);
		
		// app name logo
		titleLabel = new JLabel("AMS STORE", JLabel.CENTER);
		titleLabel.setVerticalTextPosition(JLabel.CENTER);
		
		titleLabel.setHorizontalTextPosition(JLabel.CENTER);
		titleLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
		titleLabel.setFont(new Font("Century Gothic", Font.BOLD, 50));
		titleLabel.setForeground(Color.gray);
        this.add(titleLabel);
        
        this.add(Box.createRigidArea(new Dimension(0,30)));
        
		// label to direct the user
		selectUserLabel = new JLabel("Select your user type:", JLabel.CENTER);
		selectUserLabel.setVerticalTextPosition(JLabel.CENTER);
		
		selectUserLabel.setHorizontalTextPosition(JLabel.CENTER);
        selectUserLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
        selectUserLabel.setFont(new Font("Century Gothic", Font.BOLD, 15));
        selectUserLabel.setForeground(Color.gray);
        this.add(selectUserLabel);
        
        this.add(Box.createRigidArea(new Dimension(0,5)));
		
        // list of users to choose from, by default on first one
        userList = new JComboBox(userTypes);
        userList.setSelectedIndex(0);
        userList.setAlignmentX(Component.CENTER_ALIGNMENT);
        userList.setForeground(Color.gray);
        userList.setBackground(Color.white);
        userList.setFont(new Font("Century Gothic", Font.PLAIN, 13));
        userList.setMaximumSize(new Dimension(200,20));
        userList.setSize(new Dimension(200, 20)); 
        //userList.addActionListener(this);
        this.add(userList);
        
        this.add(Box.createRigidArea(new Dimension(0,15)));
        
        // continue button
        continueButton = GUI_AMSStoreMain.makeGrayWhiteButton("Continue", Component.CENTER_ALIGNMENT);
		this.add(continueButton);
	}

}
